﻿namespace WinForms.ControlList.Processing
{
    using Bll.Comm;
    using Bll.Processing;
    using Bll.Stock;
    using Bll.Systems;
    using Model.Comm;
    using Model.Processing;
    using Model.Stock;
    using Model.Systems;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.ControlList.Comm;
    using WinForms.ControlList.Stock;
    using WinForms.Properties;

    public class FrmTeaMixedEdit : Form
    {
        private DataGridViewTextBoxColumn Amount;
        private DataGridViewTextBoxColumn AmountUnit;
        private Button btn_Close;
        private Button btn_Save;
        private DataGridViewCheckBoxColumn chk_chkItem;
        private DataGridViewTextBoxColumn CommId;
        private DataGridViewLinkColumn CommName;
        private DataGridViewTextBoxColumn CommType;
        private DataGridViewTextBoxColumn CommTypeId;
        private DataGridViewTextBoxColumn CommUnitId;
        private IContainer components;
        private DataGridView DataGridList;
        private DateTimePicker dateTime_CreateTime;
        private DataGridViewTextBoxColumn DlId;
        private ComboBoxNew drp_CommUnit;
        private ComboBoxNew drp_DlList;
        private FormHelper fh;
        private FrmStockSelect frmStockSelect;
        public const int HTCAPTION = 2;
        private int id;
        private Label lbl_BiTian;
        private Label lbl_CommId;
        private Label lbl_CommName;
        private Label lbl_CommPrice;
        private Label lbl_CommTypeId;
        private Label lbl_CommUnit;
        private Label lbl_CreateMan;
        private Label lbl_CreateManValue;
        private Label lbl_CreateTime;
        private Label lbl_LotNum;
        private Label lbl_MixedNum;
        private Label lbl_NewTeaDlid;
        private Label lbl_NewTeaWeight;
        private Label lbl_Remark;
        private Label lbl_TeaType;
        private Label lbl_TiShi;
        private Label lbl_TiShi2;
        private Label lbl_XuanTian;
        private Label lblTitle;
        private LinkLabel link_AddComm;
        private LinkLabel link_AddRow;
        private LinkLabel link_DeleteRow;
        private LinkLabel link_SelectComm;
        private DataGridViewTextBoxColumn LotNum;
        private DataGridViewTextBoxColumn MixedCommId;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Table1;
        private Panel pan_Table2;
        private Panel pan_Table3;
        private Panel pan_Table4;
        private Panel pan_Table5;
        private Panel pan_td0;
        private Panel pan_td1;
        private Panel pan_td10;
        private Panel pan_td11;
        private Panel pan_td12;
        private Panel pan_td13;
        private Panel pan_td14;
        private Panel pan_td15;
        private Panel pan_td16;
        private Panel pan_td17;
        private Panel pan_td2;
        private Panel pan_td3;
        private Panel pan_td4;
        private Panel pan_td5;
        private Panel pan_td6;
        private Panel pan_td7;
        private Panel pan_td8;
        private Panel pan_td9;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_BiTian;
        private Panel panel_Button;
        private Panel panel_JianGe1;
        private Panel panel_XuanTian;
        private Panel panel1;
        private Panel panel3;
        private Panel panel9;
        public FrmPrompt prom;
        private RadioButton rad_JingCha;
        private RadioButton rad_MaoCha;
        private DataGridViewTextBoxColumn Remark;
        public const int SC_MOVE = 0xf010;
        private FrmSelectComm selectComm;
        private DataGridViewTextBoxColumn StockId;
        private TextBox txt_CommName;
        private TextBox txt_CommPrice;
        private TextBox txt_LotNum;
        private TextBox txt_MixedNum;
        private TextBox txt_NewTeaWeight;
        private TextBox txt_Remark;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmTeaMixedEdit()
        {
            this.id = 0;
            this.fh = new FormHelper();
            this.selectComm = null;
            this.prom = null;
            this.frmStockSelect = null;
            this.components = null;
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.DataGridList.EditMode = DataGridViewEditMode.EditOnEnter;
            this.drp_DlList.Select();
            this.DataGridList.ClearSelection();
            base.KeyPreview = true;
            base.KeyDown += new KeyEventHandler(this.Form_KeyDown);
        }

        public FrmTeaMixedEdit(int id) : this()
        {
            UserEnt loginUser = PublicAppliction.LoginUser;
            this.drp_CommUnit.BeginUpdate();
            this.drp_CommUnit.Items.Clear();
            DataTable list = ParameterBll.GetList("parrefname='numberUnit'");
            foreach (DataRow row in list.Rows)
            {
                this.drp_CommUnit.AddItem(row["parname"].ToString(), row["parid"].ToString());
            }
            if (list.Rows.Count > 0)
            {
                this.drp_CommUnit.SelectedIndex = 0;
            }
            this.drp_CommUnit.EndUpdate();
            this.drp_DlList.BeginUpdate();
            this.drp_DlList.Items.Clear();
            list = DigitallibraryBll.GetList("ChainNum=" + loginUser.ChainNum);
            foreach (DataRow row in list.Rows)
            {
                this.drp_DlList.AddItem(row["DlName"].ToString(), row["DlId"].ToString());
            }
            if (list.Rows.Count > 0)
            {
                this.drp_DlList.SelectedIndex = 0;
            }
            this.drp_DlList.EndUpdate();
            this.id = id;
            TeaMixedEnt model = TeaMixedBll.GetModel(id);
            if (model.TeaType.ToString() == "1")
            {
                this.rad_JingCha.Checked = true;
            }
            else
            {
                this.rad_MaoCha.Checked = true;
            }
            this.txt_MixedNum.Text = model.MixedNum.ToString();
            this.txt_MixedNum.ReadOnly = true;
            this.drp_DlList.SelectValueNew = model.NewTeaDlid.ToString();
            this.txt_LotNum.Text = model.LotNum.ToString();
            this.txt_CommName.Text = model.CommName.ToString();
            this.lbl_CommId.Text = model.CommId.ToString();
            this.txt_NewTeaWeight.Text = model.NewTeaWeight.ToString();
            this.txt_CommPrice.Text = model.CommPrice.ToString();
            this.drp_CommUnit.SelectValueNew = model.CommUnit.ToString();
            this.txt_Remark.Text = model.Remark.ToString();
            UserEnt ent3 = UserBll.GetModel(model.CreateMan);
            this.lbl_CreateManValue.Text = ent3.UserName;
            this.dateTime_CreateTime.Value = model.CreateTime;
            this.LoadMixedDeticl();
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.DialogResult = DialogResult.Cancel;
            base.Close();
        }

        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txt_MixedNum.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入拼堆单据编号");
                    this.prom.ShowDialog();
                    this.txt_MixedNum.Select();
                }
                else if (this.drp_DlList.SelectValueNew.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入新茶存放库位!");
                    this.prom.ShowDialog();
                    this.drp_DlList.Select();
                }
                else if (this.txt_LotNum.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入新茶批号!");
                    this.prom.ShowDialog();
                    this.txt_LotNum.Select();
                }
                else if (this.txt_CommName.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请选择新茶!");
                    this.prom.ShowDialog();
                    this.link_SelectComm.Select();
                }
                else if (this.txt_NewTeaWeight.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入新茶重量!");
                    this.prom.ShowDialog();
                    this.txt_NewTeaWeight.Select();
                }
                else if (this.txt_CommPrice.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入新茶价格!");
                    this.prom.ShowDialog();
                    this.txt_CommPrice.Select();
                }
                else if (this.drp_CommUnit.SelectValueNew.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入新茶单位!");
                    this.prom.ShowDialog();
                    this.drp_CommUnit.Select();
                }
                else
                {
                    UserEnt loginUser = PublicAppliction.LoginUser;
                    TeaMixedEnt model = TeaMixedBll.GetModel(this.id);
                    if (this.rad_MaoCha.Checked)
                    {
                        model.TeaType = 0;
                    }
                    else
                    {
                        model.TeaType = 1;
                    }
                    model.ChainNum = loginUser.ChainNum;
                    model.CheckMan = 0;
                    model.CommId = int.Parse(this.lbl_CommId.Text);
                    model.MixedNum = this.txt_MixedNum.Text.Trim();
                    model.NewTeaDlid = int.Parse(this.drp_DlList.SelectValueNew);
                    model.LotNum = this.txt_LotNum.Text.Trim();
                    model.CommName = this.txt_CommName.Text.Trim();
                    model.NewTeaWeight = decimal.Parse(this.txt_NewTeaWeight.Text.Trim());
                    model.CommPrice = decimal.Parse(this.txt_CommPrice.Text.Trim());
                    model.CommUnit = int.Parse(this.drp_CommUnit.SelectValueNew);
                    model.Remark = this.txt_Remark.Text.Trim();
                    model.CreateMan = loginUser.UserId;
                    model.CreateTime = this.dateTime_CreateTime.Value;
                    TeaMixedBll.Update(model);
                    for (int i = 0; i < this.DataGridList.Rows.Count; i++)
                    {
                        TeaMixedCommEnt ent3;
                        object obj2 = this.DataGridList.Rows[i].Cells["CommId"].Value;
                        object obj3 = this.DataGridList.Rows[i].Cells["CommTypeId"].Value;
                        object obj4 = this.DataGridList.Rows[i].Cells["mixedCommId"].Value;
                        if (obj4 != null)
                        {
                            ent3 = TeaMixedCommBll.GetModel(int.Parse(obj4.ToString()));
                            ent3.CommId = int.Parse(this.DataGridList.Rows[i].Cells["CommId"].Value.ToString());
                            ent3.CommName = this.DataGridList.Rows[i].Cells["CommName"].Value.ToString();
                            ent3.CommUnit = int.Parse(this.DataGridList.Rows[i].Cells["CommUnitId"].Value.ToString());
                            ent3.DlId = int.Parse(this.DataGridList.Rows[i].Cells["DlId"].Value.ToString());
                            ent3.StockId = int.Parse(this.DataGridList.Rows[i].Cells["StockId"].Value.ToString());
                            ent3.Weight = decimal.Parse(this.DataGridList.Rows[i].Cells["Amount"].Value.ToString());
                            TeaMixedCommBll.Update(ent3);
                        }
                        else if ((obj2 != null) && (obj3 != null))
                        {
                            ent3 = new TeaMixedCommEnt {
                                CommId = int.Parse(this.DataGridList.Rows[i].Cells["CommId"].Value.ToString()),
                                CommName = this.DataGridList.Rows[i].Cells["CommName"].Value.ToString(),
                                CommUnit = int.Parse(this.DataGridList.Rows[i].Cells["CommUnitId"].Value.ToString()),
                                DlId = int.Parse(this.DataGridList.Rows[i].Cells["DlId"].Value.ToString()),
                                StockId = int.Parse(this.DataGridList.Rows[i].Cells["StockId"].Value.ToString()),
                                Weight = decimal.Parse(this.DataGridList.Rows[i].Cells["Amount"].Value.ToString())
                            };
                            TeaMixedCommBll.Add(ent3);
                        }
                    }
                    this.prom = new FrmPrompt(true, "茶叶拼堆信息修改成功!");
                    this.prom.ShowDialog();
                    WorkLogBll.AddNewLog("茶叶拼堆信息修改成功", "FrmTeaMixedEdit", PublicAppliction.LoginUser);
                    base.DialogResult = DialogResult.OK;
                    base.Close();
                }
            }
            catch (Exception exception)
            {
                ErrorsBll.NewException(exception, PublicAppliction.LoginUser);
            }
        }

        private void DataGridList_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if ((e.RowIndex != -1) && (e.RowIndex != (this.DataGridList.Rows.Count - 1)))
            {
                int rowIndex = e.RowIndex;
                if (e.ColumnIndex == this.DataGridList.Columns["CommName"].Index)
                {
                    this.txt_CommName_Click(rowIndex);
                }
            }
        }

        private void DataGridList_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            this.fh.EditRow(this.DataGridList, 4);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void drp_CommUnit_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.txt_CommPrice.Select();
            }
        }

        private void drp_DlList_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.txt_NewTeaWeight.Select();
            }
        }

        protected void Form_KeyDown(object sender, KeyEventArgs e)
        {
            if ((e.Control && (e.KeyCode == Keys.S)) && (MessageBox.Show("您确定要保存吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK))
            {
                this.btn_Save_Click(null, null);
            }
        }

        private void InitializeComponent()
        {
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            DataGridViewCellStyle style11 = new DataGridViewCellStyle();
            this.pan_DockLeft = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.DataGridList = new DataGridView();
            this.panel3 = new Panel();
            this.dateTime_CreateTime = new DateTimePicker();
            this.lbl_CreateTime = new Label();
            this.lbl_CreateManValue = new Label();
            this.lbl_CreateMan = new Label();
            this.panel1 = new Panel();
            this.panel_XuanTian = new Panel();
            this.link_DeleteRow = new LinkLabel();
            this.link_AddRow = new LinkLabel();
            this.lbl_XuanTian = new Label();
            this.panel_JianGe1 = new Panel();
            this.pan_Table5 = new Panel();
            this.pan_td17 = new Panel();
            this.txt_Remark = new TextBox();
            this.pan_td16 = new Panel();
            this.lbl_Remark = new Label();
            this.pan_Table4 = new Panel();
            this.pan_td15 = new Panel();
            this.txt_CommPrice = new TextBox();
            this.pan_td14 = new Panel();
            this.lbl_CommPrice = new Label();
            this.pan_td13 = new Panel();
            this.drp_CommUnit = new ComboBoxNew();
            this.pan_td12 = new Panel();
            this.lbl_CommUnit = new Label();
            this.pan_Table3 = new Panel();
            this.pan_td11 = new Panel();
            this.link_SelectComm = new LinkLabel();
            this.link_AddComm = new LinkLabel();
            this.txt_CommName = new TextBox();
            this.pan_td10 = new Panel();
            this.lbl_CommName = new Label();
            this.pan_td9 = new Panel();
            this.txt_NewTeaWeight = new TextBox();
            this.pan_td8 = new Panel();
            this.lbl_NewTeaWeight = new Label();
            this.pan_Table2 = new Panel();
            this.pan_td7 = new Panel();
            this.drp_DlList = new ComboBoxNew();
            this.pan_td6 = new Panel();
            this.lbl_NewTeaDlid = new Label();
            this.pan_td5 = new Panel();
            this.txt_LotNum = new TextBox();
            this.pan_td4 = new Panel();
            this.lbl_LotNum = new Label();
            this.pan_Table1 = new Panel();
            this.pan_td3 = new Panel();
            this.rad_JingCha = new RadioButton();
            this.rad_MaoCha = new RadioButton();
            this.pan_td2 = new Panel();
            this.lbl_TeaType = new Label();
            this.pan_td1 = new Panel();
            this.txt_MixedNum = new TextBox();
            this.pan_td0 = new Panel();
            this.lbl_MixedNum = new Label();
            this.panel_BiTian = new Panel();
            this.lbl_CommTypeId = new Label();
            this.lbl_CommId = new Label();
            this.lbl_BiTian = new Label();
            this.panel_Button = new Panel();
            this.lbl_TiShi2 = new Label();
            this.lbl_TiShi = new Label();
            this.btn_Close = new Button();
            this.btn_Save = new Button();
            this.panel9 = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.chk_chkItem = new DataGridViewCheckBoxColumn();
            this.LotNum = new DataGridViewTextBoxColumn();
            this.CommType = new DataGridViewTextBoxColumn();
            this.CommName = new DataGridViewLinkColumn();
            this.Amount = new DataGridViewTextBoxColumn();
            this.AmountUnit = new DataGridViewTextBoxColumn();
            this.Remark = new DataGridViewTextBoxColumn();
            this.CommId = new DataGridViewTextBoxColumn();
            this.CommTypeId = new DataGridViewTextBoxColumn();
            this.CommUnitId = new DataGridViewTextBoxColumn();
            this.DlId = new DataGridViewTextBoxColumn();
            this.StockId = new DataGridViewTextBoxColumn();
            this.MixedCommId = new DataGridViewTextBoxColumn();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            ((ISupportInitialize) this.DataGridList).BeginInit();
            this.panel3.SuspendLayout();
            this.panel_XuanTian.SuspendLayout();
            this.pan_Table5.SuspendLayout();
            this.pan_td17.SuspendLayout();
            this.pan_td16.SuspendLayout();
            this.pan_Table4.SuspendLayout();
            this.pan_td15.SuspendLayout();
            this.pan_td14.SuspendLayout();
            this.pan_td13.SuspendLayout();
            this.pan_td12.SuspendLayout();
            this.pan_Table3.SuspendLayout();
            this.pan_td11.SuspendLayout();
            this.pan_td10.SuspendLayout();
            this.pan_td9.SuspendLayout();
            this.pan_td8.SuspendLayout();
            this.pan_Table2.SuspendLayout();
            this.pan_td7.SuspendLayout();
            this.pan_td6.SuspendLayout();
            this.pan_td5.SuspendLayout();
            this.pan_td4.SuspendLayout();
            this.pan_Table1.SuspendLayout();
            this.pan_td3.SuspendLayout();
            this.pan_td2.SuspendLayout();
            this.pan_td1.SuspendLayout();
            this.pan_td0.SuspendLayout();
            this.panel_BiTian.SuspendLayout();
            this.panel_Button.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x218);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x336, 0x218);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(820, 0x217);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.DataGridList);
            this.pan_AllPlanes.Controls.Add(this.panel3);
            this.pan_AllPlanes.Controls.Add(this.panel1);
            this.pan_AllPlanes.Controls.Add(this.panel_XuanTian);
            this.pan_AllPlanes.Controls.Add(this.panel_JianGe1);
            this.pan_AllPlanes.Controls.Add(this.pan_Table5);
            this.pan_AllPlanes.Controls.Add(this.pan_Table4);
            this.pan_AllPlanes.Controls.Add(this.pan_Table3);
            this.pan_AllPlanes.Controls.Add(this.pan_Table2);
            this.pan_AllPlanes.Controls.Add(this.pan_Table1);
            this.pan_AllPlanes.Controls.Add(this.panel_BiTian);
            this.pan_AllPlanes.Controls.Add(this.panel_Button);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(800, 0x203);
            this.pan_AllPlanes.TabIndex = 4;
            this.DataGridList.AllowUserToAddRows = false;
            this.DataGridList.AllowUserToDeleteRows = false;
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style.BackColor = Color.FromArgb(0xf9, 0xf9, 0xf9);
            this.DataGridList.AlternatingRowsDefaultCellStyle = style;
            this.DataGridList.BackgroundColor = Color.WhiteSmoke;
            this.DataGridList.BorderStyle = BorderStyle.None;
            style2.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style2.BackColor = Color.White;
            style2.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style2.ForeColor = SystemColors.WindowText;
            style2.SelectionBackColor = SystemColors.Highlight;
            style2.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.ColumnHeadersDefaultCellStyle = style2;
            this.DataGridList.Columns.AddRange(new DataGridViewColumn[] { this.chk_chkItem, this.LotNum, this.CommType, this.CommName, this.Amount, this.AmountUnit, this.Remark, this.CommId, this.CommTypeId, this.CommUnitId, this.DlId, this.StockId, this.MixedCommId });
            style3.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style3.BackColor = SystemColors.Window;
            style3.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style3.ForeColor = SystemColors.ControlText;
            style3.SelectionBackColor = SystemColors.Highlight;
            style3.SelectionForeColor = SystemColors.HighlightText;
            style3.WrapMode = DataGridViewTriState.False;
            this.DataGridList.DefaultCellStyle = style3;
            this.DataGridList.Dock = DockStyle.Fill;
            this.DataGridList.EnableHeadersVisualStyles = false;
            this.DataGridList.GridColor = Color.FromArgb(0xab, 0xb9, 0x9d);
            this.DataGridList.Location = new Point(0, 0xb9);
            this.DataGridList.Name = "DataGridList";
            style4.Alignment = DataGridViewContentAlignment.BottomCenter;
            style4.BackColor = Color.White;
            style4.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style4.ForeColor = SystemColors.WindowText;
            style4.SelectionBackColor = SystemColors.Highlight;
            style4.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.RowHeadersDefaultCellStyle = style4;
            style5.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridList.RowsDefaultCellStyle = style5;
            this.DataGridList.RowTemplate.Height = 0x17;
            this.DataGridList.Size = new Size(800, 0xfc);
            this.DataGridList.TabIndex = 15;
            this.DataGridList.CellEndEdit += new DataGridViewCellEventHandler(this.DataGridList_CellEndEdit);
            this.DataGridList.CellClick += new DataGridViewCellEventHandler(this.DataGridList_CellClick);
            this.panel3.Controls.Add(this.dateTime_CreateTime);
            this.panel3.Controls.Add(this.lbl_CreateTime);
            this.panel3.Controls.Add(this.lbl_CreateManValue);
            this.panel3.Controls.Add(this.lbl_CreateMan);
            this.panel3.Dock = DockStyle.Bottom;
            this.panel3.Location = new Point(0, 0x1b5);
            this.panel3.Name = "panel3";
            this.panel3.Size = new Size(800, 0x19);
            this.panel3.TabIndex = 14;
            this.panel3.Paint += new PaintEventHandler(this.panel3_Paint);
            this.dateTime_CreateTime.Location = new Point(0x1fc, 2);
            this.dateTime_CreateTime.Name = "dateTime_CreateTime";
            this.dateTime_CreateTime.Size = new Size(0xdf, 0x15);
            this.dateTime_CreateTime.TabIndex = 0;
            this.lbl_CreateTime.Location = new Point(0x1a8, 6);
            this.lbl_CreateTime.Name = "lbl_CreateTime";
            this.lbl_CreateTime.Size = new Size(0x54, 12);
            this.lbl_CreateTime.TabIndex = 0;
            this.lbl_CreateTime.Text = "拼堆时间:";
            this.lbl_CreateTime.TextAlign = ContentAlignment.MiddleRight;
            this.lbl_CreateManValue.AutoSize = true;
            this.lbl_CreateManValue.Location = new Point(0x76, 6);
            this.lbl_CreateManValue.Name = "lbl_CreateManValue";
            this.lbl_CreateManValue.Size = new Size(0x29, 12);
            this.lbl_CreateManValue.TabIndex = 1;
            this.lbl_CreateManValue.Text = "label1";
            this.lbl_CreateMan.AutoSize = true;
            this.lbl_CreateMan.Location = new Point(0x45, 6);
            this.lbl_CreateMan.Name = "lbl_CreateMan";
            this.lbl_CreateMan.Size = new Size(0x2f, 12);
            this.lbl_CreateMan.TabIndex = 0;
            this.lbl_CreateMan.Text = "拼堆人:";
            this.panel1.Dock = DockStyle.Bottom;
            this.panel1.Location = new Point(0, 0x1ce);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(800, 5);
            this.panel1.TabIndex = 13;
            this.panel_XuanTian.Controls.Add(this.link_DeleteRow);
            this.panel_XuanTian.Controls.Add(this.link_AddRow);
            this.panel_XuanTian.Controls.Add(this.lbl_XuanTian);
            this.panel_XuanTian.Dock = DockStyle.Top;
            this.panel_XuanTian.Location = new Point(0, 160);
            this.panel_XuanTian.Name = "panel_XuanTian";
            this.panel_XuanTian.Size = new Size(800, 0x19);
            this.panel_XuanTian.TabIndex = 10;
            this.panel_XuanTian.Paint += new PaintEventHandler(this.panel_XuanTian_Paint);
            this.link_DeleteRow.AutoSize = true;
            this.link_DeleteRow.Location = new Point(0x2d8, 6);
            this.link_DeleteRow.Name = "link_DeleteRow";
            this.link_DeleteRow.Size = new Size(0x35, 12);
            this.link_DeleteRow.TabIndex = 1;
            this.link_DeleteRow.TabStop = true;
            this.link_DeleteRow.Text = "[删除行]";
            this.link_DeleteRow.LinkClicked += new LinkLabelLinkClickedEventHandler(this.link_DeleteRow_LinkClicked);
            this.link_AddRow.AutoSize = true;
            this.link_AddRow.Location = new Point(0x29d, 6);
            this.link_AddRow.Name = "link_AddRow";
            this.link_AddRow.Size = new Size(0x35, 12);
            this.link_AddRow.TabIndex = 0;
            this.link_AddRow.TabStop = true;
            this.link_AddRow.Text = "[新增行]";
            this.link_AddRow.LinkClicked += new LinkLabelLinkClickedEventHandler(this.link_AddRow_LinkClicked);
            this.lbl_XuanTian.AutoSize = true;
            this.lbl_XuanTian.Location = new Point(10, 6);
            this.lbl_XuanTian.Name = "lbl_XuanTian";
            this.lbl_XuanTian.Size = new Size(0x35, 12);
            this.lbl_XuanTian.TabIndex = 0;
            this.lbl_XuanTian.Text = "拼堆信息";
            this.panel_JianGe1.Dock = DockStyle.Top;
            this.panel_JianGe1.Location = new Point(0, 150);
            this.panel_JianGe1.Name = "panel_JianGe1";
            this.panel_JianGe1.Size = new Size(800, 10);
            this.panel_JianGe1.TabIndex = 0;
            this.pan_Table5.Controls.Add(this.pan_td17);
            this.pan_Table5.Controls.Add(this.pan_td16);
            this.pan_Table5.Dock = DockStyle.Top;
            this.pan_Table5.Location = new Point(0, 0x7d);
            this.pan_Table5.Name = "pan_Table5";
            this.pan_Table5.Size = new Size(800, 0x19);
            this.pan_Table5.TabIndex = 1;
            this.pan_td17.Controls.Add(this.txt_Remark);
            this.pan_td17.Dock = DockStyle.Fill;
            this.pan_td17.Location = new Point(150, 0);
            this.pan_td17.Name = "pan_td17";
            this.pan_td17.Size = new Size(650, 0x19);
            this.pan_td17.TabIndex = 2;
            this.pan_td17.Paint += new PaintEventHandler(this.pan_td17_Paint);
            this.txt_Remark.Location = new Point(5, 2);
            this.txt_Remark.MaxLength = 20;
            this.txt_Remark.Name = "txt_Remark";
            this.txt_Remark.Size = new Size(0x275, 0x15);
            this.txt_Remark.TabIndex = 9;
            this.txt_Remark.KeyPress += new KeyPressEventHandler(this.txt_Remark_KeyPress);
            this.pan_td16.Controls.Add(this.lbl_Remark);
            this.pan_td16.Dock = DockStyle.Left;
            this.pan_td16.Location = new Point(0, 0);
            this.pan_td16.Name = "pan_td16";
            this.pan_td16.Size = new Size(150, 0x19);
            this.pan_td16.TabIndex = 3;
            this.pan_td16.Paint += new PaintEventHandler(this.pan_td16_Paint);
            this.lbl_Remark.Location = new Point(0x3e, 5);
            this.lbl_Remark.Name = "lbl_Remark";
            this.lbl_Remark.Size = new Size(0x54, 12);
            this.lbl_Remark.TabIndex = 0;
            this.lbl_Remark.Text = "备注:";
            this.lbl_Remark.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table4.Controls.Add(this.pan_td15);
            this.pan_Table4.Controls.Add(this.pan_td14);
            this.pan_Table4.Controls.Add(this.pan_td13);
            this.pan_Table4.Controls.Add(this.pan_td12);
            this.pan_Table4.Dock = DockStyle.Top;
            this.pan_Table4.Location = new Point(0, 100);
            this.pan_Table4.Name = "pan_Table4";
            this.pan_Table4.Size = new Size(800, 0x19);
            this.pan_Table4.TabIndex = 4;
            this.pan_td15.Controls.Add(this.txt_CommPrice);
            this.pan_td15.Dock = DockStyle.Left;
            this.pan_td15.Location = new Point(550, 0);
            this.pan_td15.Name = "pan_td15";
            this.pan_td15.Size = new Size(250, 0x19);
            this.pan_td15.TabIndex = 0;
            this.pan_td15.Paint += new PaintEventHandler(this.pan_td15_Paint);
            this.txt_CommPrice.Location = new Point(4, 2);
            this.txt_CommPrice.MaxLength = 20;
            this.txt_CommPrice.Name = "txt_CommPrice";
            this.txt_CommPrice.Size = new Size(230, 0x15);
            this.txt_CommPrice.TabIndex = 8;
            this.txt_CommPrice.Text = "0.00";
            this.txt_CommPrice.KeyPress += new KeyPressEventHandler(this.txt_CommPrice_KeyPress);
            this.pan_td14.Controls.Add(this.lbl_CommPrice);
            this.pan_td14.Dock = DockStyle.Left;
            this.pan_td14.Location = new Point(400, 0);
            this.pan_td14.Name = "pan_td14";
            this.pan_td14.Size = new Size(150, 0x19);
            this.pan_td14.TabIndex = 1;
            this.pan_td14.Paint += new PaintEventHandler(this.pan_td14_Paint);
            this.lbl_CommPrice.Location = new Point(0x3e, 5);
            this.lbl_CommPrice.Name = "lbl_CommPrice";
            this.lbl_CommPrice.Size = new Size(0x54, 12);
            this.lbl_CommPrice.TabIndex = 0;
            this.lbl_CommPrice.Text = "新茶价格:";
            this.lbl_CommPrice.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td13.Controls.Add(this.drp_CommUnit);
            this.pan_td13.Dock = DockStyle.Left;
            this.pan_td13.Location = new Point(150, 0);
            this.pan_td13.Name = "pan_td13";
            this.pan_td13.Size = new Size(250, 0x19);
            this.pan_td13.TabIndex = 2;
            this.pan_td13.Paint += new PaintEventHandler(this.pan_td13_Paint);
            this.drp_CommUnit.DisplayMember = "Name";
            this.drp_CommUnit.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_CommUnit.FormattingEnabled = true;
            this.drp_CommUnit.Location = new Point(5, 2);
            this.drp_CommUnit.Name = "drp_CommUnit";
            this.drp_CommUnit.SelectValueNew = "";
            this.drp_CommUnit.Size = new Size(230, 20);
            this.drp_CommUnit.TabIndex = 2;
            this.drp_CommUnit.ValueMember = "Value";
            this.drp_CommUnit.KeyPress += new KeyPressEventHandler(this.drp_CommUnit_KeyPress);
            this.pan_td12.Controls.Add(this.lbl_CommUnit);
            this.pan_td12.Dock = DockStyle.Left;
            this.pan_td12.Location = new Point(0, 0);
            this.pan_td12.Name = "pan_td12";
            this.pan_td12.Size = new Size(150, 0x19);
            this.pan_td12.TabIndex = 3;
            this.pan_td12.Paint += new PaintEventHandler(this.pan_td12_Paint);
            this.lbl_CommUnit.Location = new Point(0x3e, 5);
            this.lbl_CommUnit.Name = "lbl_CommUnit";
            this.lbl_CommUnit.Size = new Size(0x54, 12);
            this.lbl_CommUnit.TabIndex = 0;
            this.lbl_CommUnit.Text = "新茶单位:";
            this.lbl_CommUnit.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table3.Controls.Add(this.pan_td11);
            this.pan_Table3.Controls.Add(this.pan_td10);
            this.pan_Table3.Controls.Add(this.pan_td9);
            this.pan_Table3.Controls.Add(this.pan_td8);
            this.pan_Table3.Dock = DockStyle.Top;
            this.pan_Table3.Location = new Point(0, 0x4b);
            this.pan_Table3.Name = "pan_Table3";
            this.pan_Table3.Size = new Size(800, 0x19);
            this.pan_Table3.TabIndex = 5;
            this.pan_td11.Controls.Add(this.link_SelectComm);
            this.pan_td11.Controls.Add(this.link_AddComm);
            this.pan_td11.Controls.Add(this.txt_CommName);
            this.pan_td11.Dock = DockStyle.Left;
            this.pan_td11.Location = new Point(550, 0);
            this.pan_td11.Name = "pan_td11";
            this.pan_td11.Size = new Size(250, 0x19);
            this.pan_td11.TabIndex = 0;
            this.pan_td11.Paint += new PaintEventHandler(this.pan_td11_Paint);
            this.link_SelectComm.AutoSize = true;
            this.link_SelectComm.Location = new Point(0x77, 6);
            this.link_SelectComm.Name = "link_SelectComm";
            this.link_SelectComm.Size = new Size(0x35, 12);
            this.link_SelectComm.TabIndex = 9;
            this.link_SelectComm.TabStop = true;
            this.link_SelectComm.Text = "选择商品";
            this.link_SelectComm.LinkClicked += new LinkLabelLinkClickedEventHandler(this.link_SelectComm_LinkClicked);
            this.link_AddComm.AutoSize = true;
            this.link_AddComm.Location = new Point(0xb3, 6);
            this.link_AddComm.Name = "link_AddComm";
            this.link_AddComm.Size = new Size(0x35, 12);
            this.link_AddComm.TabIndex = 7;
            this.link_AddComm.TabStop = true;
            this.link_AddComm.Text = "新增商品";
            this.link_AddComm.LinkClicked += new LinkLabelLinkClickedEventHandler(this.link_AddComm_LinkClicked);
            this.txt_CommName.Location = new Point(4, 2);
            this.txt_CommName.MaxLength = 20;
            this.txt_CommName.Name = "txt_CommName";
            this.txt_CommName.Size = new Size(0x6d, 0x15);
            this.txt_CommName.TabIndex = 6;
            this.txt_CommName.Click += new EventHandler(this.txt_CommName_Click);
            this.pan_td10.Controls.Add(this.lbl_CommName);
            this.pan_td10.Dock = DockStyle.Left;
            this.pan_td10.Location = new Point(400, 0);
            this.pan_td10.Name = "pan_td10";
            this.pan_td10.Size = new Size(150, 0x19);
            this.pan_td10.TabIndex = 1;
            this.pan_td10.Paint += new PaintEventHandler(this.pan_td10_Paint);
            this.lbl_CommName.Location = new Point(0x3e, 5);
            this.lbl_CommName.Name = "lbl_CommName";
            this.lbl_CommName.Size = new Size(0x54, 12);
            this.lbl_CommName.TabIndex = 0;
            this.lbl_CommName.Text = "新茶名称:";
            this.lbl_CommName.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td9.Controls.Add(this.txt_NewTeaWeight);
            this.pan_td9.Dock = DockStyle.Left;
            this.pan_td9.Location = new Point(150, 0);
            this.pan_td9.Name = "pan_td9";
            this.pan_td9.Size = new Size(250, 0x19);
            this.pan_td9.TabIndex = 2;
            this.pan_td9.Paint += new PaintEventHandler(this.pan_td9_Paint);
            this.txt_NewTeaWeight.Location = new Point(5, 2);
            this.txt_NewTeaWeight.MaxLength = 20;
            this.txt_NewTeaWeight.Name = "txt_NewTeaWeight";
            this.txt_NewTeaWeight.Size = new Size(230, 0x15);
            this.txt_NewTeaWeight.TabIndex = 5;
            this.txt_NewTeaWeight.Text = "0.00";
            this.txt_NewTeaWeight.KeyPress += new KeyPressEventHandler(this.txt_NewTeaWeight_KeyPress);
            this.pan_td8.Controls.Add(this.lbl_NewTeaWeight);
            this.pan_td8.Dock = DockStyle.Left;
            this.pan_td8.Location = new Point(0, 0);
            this.pan_td8.Name = "pan_td8";
            this.pan_td8.Size = new Size(150, 0x19);
            this.pan_td8.TabIndex = 3;
            this.pan_td8.Paint += new PaintEventHandler(this.pan_td8_Paint);
            this.lbl_NewTeaWeight.Location = new Point(0x3e, 5);
            this.lbl_NewTeaWeight.Name = "lbl_NewTeaWeight";
            this.lbl_NewTeaWeight.Size = new Size(0x54, 12);
            this.lbl_NewTeaWeight.TabIndex = 0;
            this.lbl_NewTeaWeight.Text = "新茶重量:";
            this.lbl_NewTeaWeight.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table2.Controls.Add(this.pan_td7);
            this.pan_Table2.Controls.Add(this.pan_td6);
            this.pan_Table2.Controls.Add(this.pan_td5);
            this.pan_Table2.Controls.Add(this.pan_td4);
            this.pan_Table2.Dock = DockStyle.Top;
            this.pan_Table2.Location = new Point(0, 50);
            this.pan_Table2.Name = "pan_Table2";
            this.pan_Table2.Size = new Size(800, 0x19);
            this.pan_Table2.TabIndex = 6;
            this.pan_td7.Controls.Add(this.drp_DlList);
            this.pan_td7.Dock = DockStyle.Left;
            this.pan_td7.Location = new Point(550, 0);
            this.pan_td7.Name = "pan_td7";
            this.pan_td7.Size = new Size(250, 0x19);
            this.pan_td7.TabIndex = 0;
            this.pan_td7.Paint += new PaintEventHandler(this.pan_td7_Paint);
            this.drp_DlList.DisplayMember = "Name";
            this.drp_DlList.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_DlList.FormattingEnabled = true;
            this.drp_DlList.Location = new Point(4, 2);
            this.drp_DlList.Name = "drp_DlList";
            this.drp_DlList.SelectValueNew = "";
            this.drp_DlList.Size = new Size(230, 20);
            this.drp_DlList.TabIndex = 3;
            this.drp_DlList.ValueMember = "Value";
            this.drp_DlList.KeyPress += new KeyPressEventHandler(this.drp_DlList_KeyPress);
            this.pan_td6.Controls.Add(this.lbl_NewTeaDlid);
            this.pan_td6.Dock = DockStyle.Left;
            this.pan_td6.Location = new Point(400, 0);
            this.pan_td6.Name = "pan_td6";
            this.pan_td6.Size = new Size(150, 0x19);
            this.pan_td6.TabIndex = 1;
            this.pan_td6.Paint += new PaintEventHandler(this.pan_td6_Paint);
            this.lbl_NewTeaDlid.Location = new Point(0x3e, 5);
            this.lbl_NewTeaDlid.Name = "lbl_NewTeaDlid";
            this.lbl_NewTeaDlid.Size = new Size(0x54, 12);
            this.lbl_NewTeaDlid.TabIndex = 0;
            this.lbl_NewTeaDlid.Text = "新茶存放库位:";
            this.lbl_NewTeaDlid.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td5.Controls.Add(this.txt_LotNum);
            this.pan_td5.Dock = DockStyle.Left;
            this.pan_td5.Location = new Point(150, 0);
            this.pan_td5.Name = "pan_td5";
            this.pan_td5.Size = new Size(250, 0x19);
            this.pan_td5.TabIndex = 2;
            this.pan_td5.Paint += new PaintEventHandler(this.pan_td5_Paint);
            this.txt_LotNum.Location = new Point(5, 2);
            this.txt_LotNum.MaxLength = 20;
            this.txt_LotNum.Name = "txt_LotNum";
            this.txt_LotNum.Size = new Size(230, 0x15);
            this.txt_LotNum.TabIndex = 3;
            this.pan_td4.Controls.Add(this.lbl_LotNum);
            this.pan_td4.Dock = DockStyle.Left;
            this.pan_td4.Location = new Point(0, 0);
            this.pan_td4.Name = "pan_td4";
            this.pan_td4.Size = new Size(150, 0x19);
            this.pan_td4.TabIndex = 3;
            this.pan_td4.Paint += new PaintEventHandler(this.pan_td4_Paint);
            this.lbl_LotNum.Location = new Point(0x3e, 5);
            this.lbl_LotNum.Name = "lbl_LotNum";
            this.lbl_LotNum.Size = new Size(0x54, 12);
            this.lbl_LotNum.TabIndex = 0;
            this.lbl_LotNum.Text = "新茶批号:";
            this.lbl_LotNum.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table1.Controls.Add(this.pan_td3);
            this.pan_Table1.Controls.Add(this.pan_td2);
            this.pan_Table1.Controls.Add(this.pan_td1);
            this.pan_Table1.Controls.Add(this.pan_td0);
            this.pan_Table1.Dock = DockStyle.Top;
            this.pan_Table1.Location = new Point(0, 0x19);
            this.pan_Table1.Name = "pan_Table1";
            this.pan_Table1.Size = new Size(800, 0x19);
            this.pan_Table1.TabIndex = 7;
            this.pan_td3.Controls.Add(this.rad_JingCha);
            this.pan_td3.Controls.Add(this.rad_MaoCha);
            this.pan_td3.Dock = DockStyle.Left;
            this.pan_td3.Location = new Point(550, 0);
            this.pan_td3.Name = "pan_td3";
            this.pan_td3.Size = new Size(250, 0x19);
            this.pan_td3.TabIndex = 0;
            this.pan_td3.Paint += new PaintEventHandler(this.pan_td3_Paint);
            this.rad_JingCha.AutoSize = true;
            this.rad_JingCha.Location = new Point(0x3b, 4);
            this.rad_JingCha.Name = "rad_JingCha";
            this.rad_JingCha.Size = new Size(0x2f, 0x10);
            this.rad_JingCha.TabIndex = 1;
            this.rad_JingCha.Text = "净茶";
            this.rad_JingCha.UseVisualStyleBackColor = true;
            this.rad_MaoCha.AutoSize = true;
            this.rad_MaoCha.Checked = true;
            this.rad_MaoCha.Location = new Point(6, 4);
            this.rad_MaoCha.Name = "rad_MaoCha";
            this.rad_MaoCha.Size = new Size(0x2f, 0x10);
            this.rad_MaoCha.TabIndex = 0;
            this.rad_MaoCha.TabStop = true;
            this.rad_MaoCha.Text = "毛茶";
            this.rad_MaoCha.UseVisualStyleBackColor = true;
            this.pan_td2.Controls.Add(this.lbl_TeaType);
            this.pan_td2.Dock = DockStyle.Left;
            this.pan_td2.Location = new Point(400, 0);
            this.pan_td2.Name = "pan_td2";
            this.pan_td2.Size = new Size(150, 0x19);
            this.pan_td2.TabIndex = 1;
            this.pan_td2.Paint += new PaintEventHandler(this.pan_td2_Paint);
            this.lbl_TeaType.Location = new Point(0x3e, 5);
            this.lbl_TeaType.Name = "lbl_TeaType";
            this.lbl_TeaType.Size = new Size(0x54, 12);
            this.lbl_TeaType.TabIndex = 0;
            this.lbl_TeaType.Text = "毛茶或净茶:";
            this.lbl_TeaType.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td1.Controls.Add(this.txt_MixedNum);
            this.pan_td1.Dock = DockStyle.Left;
            this.pan_td1.Location = new Point(150, 0);
            this.pan_td1.Name = "pan_td1";
            this.pan_td1.Size = new Size(250, 0x19);
            this.pan_td1.TabIndex = 2;
            this.pan_td1.Paint += new PaintEventHandler(this.pan_td1_Paint);
            this.txt_MixedNum.Location = new Point(5, 2);
            this.txt_MixedNum.MaxLength = 20;
            this.txt_MixedNum.Name = "txt_MixedNum";
            this.txt_MixedNum.Size = new Size(230, 0x15);
            this.txt_MixedNum.TabIndex = 1;
            this.pan_td0.Controls.Add(this.lbl_MixedNum);
            this.pan_td0.Dock = DockStyle.Left;
            this.pan_td0.Location = new Point(0, 0);
            this.pan_td0.Name = "pan_td0";
            this.pan_td0.Size = new Size(150, 0x19);
            this.pan_td0.TabIndex = 3;
            this.pan_td0.Paint += new PaintEventHandler(this.pan_td0_Paint);
            this.lbl_MixedNum.Location = new Point(0x3e, 5);
            this.lbl_MixedNum.Name = "lbl_MixedNum";
            this.lbl_MixedNum.Size = new Size(0x54, 12);
            this.lbl_MixedNum.TabIndex = 0;
            this.lbl_MixedNum.Text = "拼堆单号:";
            this.lbl_MixedNum.TextAlign = ContentAlignment.MiddleRight;
            this.panel_BiTian.Controls.Add(this.lbl_CommTypeId);
            this.panel_BiTian.Controls.Add(this.lbl_CommId);
            this.panel_BiTian.Controls.Add(this.lbl_BiTian);
            this.panel_BiTian.Dock = DockStyle.Top;
            this.panel_BiTian.Location = new Point(0, 0);
            this.panel_BiTian.Name = "panel_BiTian";
            this.panel_BiTian.Size = new Size(800, 0x19);
            this.panel_BiTian.TabIndex = 8;
            this.panel_BiTian.Paint += new PaintEventHandler(this.panel_BiTian_Paint);
            this.lbl_CommTypeId.AutoSize = true;
            this.lbl_CommTypeId.Location = new Point(0x15c, 6);
            this.lbl_CommTypeId.Name = "lbl_CommTypeId";
            this.lbl_CommTypeId.Size = new Size(0, 12);
            this.lbl_CommTypeId.TabIndex = 0xca;
            this.lbl_CommTypeId.Visible = false;
            this.lbl_CommId.AutoSize = true;
            this.lbl_CommId.Location = new Point(0x1c5, 6);
            this.lbl_CommId.Name = "lbl_CommId";
            this.lbl_CommId.Size = new Size(0, 12);
            this.lbl_CommId.TabIndex = 0xc9;
            this.lbl_CommId.Visible = false;
            this.lbl_BiTian.AutoSize = true;
            this.lbl_BiTian.Location = new Point(10, 6);
            this.lbl_BiTian.Name = "lbl_BiTian";
            this.lbl_BiTian.Size = new Size(0x35, 12);
            this.lbl_BiTian.TabIndex = 0;
            this.lbl_BiTian.Text = "必填项目";
            this.panel_Button.Controls.Add(this.lbl_TiShi2);
            this.panel_Button.Controls.Add(this.lbl_TiShi);
            this.panel_Button.Controls.Add(this.btn_Close);
            this.panel_Button.Controls.Add(this.btn_Save);
            this.panel_Button.Dock = DockStyle.Bottom;
            this.panel_Button.Location = new Point(0, 0x1d3);
            this.panel_Button.Name = "panel_Button";
            this.panel_Button.Size = new Size(800, 0x2b);
            this.panel_Button.TabIndex = 9;
            this.panel_Button.Paint += new PaintEventHandler(this.panel_Button_Paint);
            this.lbl_TiShi2.AutoSize = true;
            this.lbl_TiShi2.Location = new Point(0x22d, 15);
            this.lbl_TiShi2.Name = "lbl_TiShi2";
            this.lbl_TiShi2.Size = new Size(0xe3, 12);
            this.lbl_TiShi2.TabIndex = 14;
            this.lbl_TiShi2.Text = "使用小技巧: Ctrl+S 快速保存 拼堆信息.";
            this.lbl_TiShi.AutoSize = true;
            this.lbl_TiShi.Location = new Point(10, 15);
            this.lbl_TiShi.Name = "lbl_TiShi";
            this.lbl_TiShi.Size = new Size(0xef, 12);
            this.lbl_TiShi.TabIndex = 13;
            this.lbl_TiShi.Text = "使用小技巧:回车(Enter)跳到下一个输入项.";
            this.btn_Close.Location = new Point(0x1ad, 10);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 11;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.btn_Save.Location = new Point(0x128, 10);
            this.btn_Save.Name = "btn_Save";
            this.btn_Save.Size = new Size(0x4b, 0x17);
            this.btn_Save.TabIndex = 10;
            this.btn_Save.Text = "保 存";
            this.btn_Save.UseVisualStyleBackColor = true;
            this.btn_Save.Click += new EventHandler(this.btn_Save_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 510);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(800, 5);
            this.panel9.TabIndex = 3;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(810, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x203);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x203);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x20d);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(820, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(820, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x217);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(820, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x335, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x218);
            this.pan_DockRight.TabIndex = 1;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x336, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x312, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x3f, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "修改拼堆";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x331, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            style6.NullValue = false;
            this.chk_chkItem.DefaultCellStyle = style6;
            this.chk_chkItem.FalseValue = "";
            this.chk_chkItem.HeaderText = "选项";
            this.chk_chkItem.IndeterminateValue = "";
            this.chk_chkItem.Name = "chk_chkItem";
            this.chk_chkItem.TrueValue = "";
            this.chk_chkItem.Width = 50;
            this.LotNum.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.LotNum.DataPropertyName = "LotNum";
            style7.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style7.BackColor = Color.White;
            this.LotNum.DefaultCellStyle = style7;
            this.LotNum.FillWeight = 150f;
            this.LotNum.HeaderText = "批号";
            this.LotNum.Name = "LotNum";
            this.LotNum.ReadOnly = true;
            this.LotNum.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.CommType.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CommType.DataPropertyName = "CommType";
            style8.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style8.BackColor = Color.White;
            this.CommType.DefaultCellStyle = style8;
            this.CommType.FillWeight = 150f;
            this.CommType.HeaderText = "商品类型";
            this.CommType.Name = "CommType";
            this.CommType.ReadOnly = true;
            this.CommType.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.CommName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CommName.DataPropertyName = "CommName";
            style9.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style9.BackColor = Color.White;
            this.CommName.DefaultCellStyle = style9;
            this.CommName.FillWeight = 150f;
            this.CommName.HeaderText = "商品名称";
            this.CommName.Name = "CommName";
            this.CommName.ReadOnly = true;
            this.CommName.Resizable = DataGridViewTriState.True;
            this.Amount.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Amount.DataPropertyName = "Amount";
            this.Amount.FillWeight = 90f;
            this.Amount.HeaderText = "数量";
            this.Amount.Name = "Amount";
            this.Amount.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.AmountUnit.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.AmountUnit.DataPropertyName = "AmountUnit";
            style10.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.AmountUnit.DefaultCellStyle = style10;
            this.AmountUnit.FillWeight = 90f;
            this.AmountUnit.HeaderText = "单位";
            this.AmountUnit.Name = "AmountUnit";
            this.AmountUnit.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.Remark.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Remark.DataPropertyName = "Remark";
            style11.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style11.BackColor = Color.White;
            this.Remark.DefaultCellStyle = style11;
            this.Remark.FillWeight = 150f;
            this.Remark.HeaderText = "商品规格";
            this.Remark.Name = "Remark";
            this.Remark.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.CommId.HeaderText = "CommId";
            this.CommId.Name = "CommId";
            this.CommId.Visible = false;
            this.CommTypeId.HeaderText = "CommTypeId";
            this.CommTypeId.Name = "CommTypeId";
            this.CommTypeId.Visible = false;
            this.CommUnitId.DataPropertyName = "CommUnitId";
            this.CommUnitId.HeaderText = "CommUnitId";
            this.CommUnitId.Name = "CommUnitId";
            this.CommUnitId.Visible = false;
            this.DlId.HeaderText = "DlId";
            this.DlId.Name = "DlId";
            this.DlId.Visible = false;
            this.StockId.HeaderText = "StockId";
            this.StockId.Name = "StockId";
            this.StockId.Visible = false;
            this.MixedCommId.HeaderText = "MixedCommId";
            this.MixedCommId.Name = "MixedCommId";
            this.MixedCommId.Visible = false;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x336, 0x238);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = FormBorderStyle.None;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmTeaMixedEdit";
            base.ShowInTaskbar = false;
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridList).EndInit();
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.panel_XuanTian.ResumeLayout(false);
            this.panel_XuanTian.PerformLayout();
            this.pan_Table5.ResumeLayout(false);
            this.pan_td17.ResumeLayout(false);
            this.pan_td17.PerformLayout();
            this.pan_td16.ResumeLayout(false);
            this.pan_Table4.ResumeLayout(false);
            this.pan_td15.ResumeLayout(false);
            this.pan_td15.PerformLayout();
            this.pan_td14.ResumeLayout(false);
            this.pan_td13.ResumeLayout(false);
            this.pan_td12.ResumeLayout(false);
            this.pan_Table3.ResumeLayout(false);
            this.pan_td11.ResumeLayout(false);
            this.pan_td11.PerformLayout();
            this.pan_td10.ResumeLayout(false);
            this.pan_td9.ResumeLayout(false);
            this.pan_td9.PerformLayout();
            this.pan_td8.ResumeLayout(false);
            this.pan_Table2.ResumeLayout(false);
            this.pan_td7.ResumeLayout(false);
            this.pan_td6.ResumeLayout(false);
            this.pan_td5.ResumeLayout(false);
            this.pan_td5.PerformLayout();
            this.pan_td4.ResumeLayout(false);
            this.pan_Table1.ResumeLayout(false);
            this.pan_td3.ResumeLayout(false);
            this.pan_td3.PerformLayout();
            this.pan_td2.ResumeLayout(false);
            this.pan_td1.ResumeLayout(false);
            this.pan_td1.PerformLayout();
            this.pan_td0.ResumeLayout(false);
            this.panel_BiTian.ResumeLayout(false);
            this.panel_BiTian.PerformLayout();
            this.panel_Button.ResumeLayout(false);
            this.panel_Button.PerformLayout();
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void link_AddComm_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmCommAdd add = new FrmCommAdd();
            if (add.ShowDialog() == DialogResult.OK)
            {
                this.txt_CommName.Text = add.NewCommName;
                this.lbl_CommId.Text = add.NewCommId;
                this.lbl_CommTypeId.Text = add.NewCommTypeId;
            }
            add.Dispose();
        }

        private void link_AddRow_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.fh.AddRow(this.DataGridList, 6);
            this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[1].Value = "无";
            this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[2].Value = "无";
            this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[3].Value = "选择商品";
            this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[4].Value = "0.00";
            this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[6].Value = "无";
            this.fh.TotalRow(this.DataGridList, 4);
        }

        private void link_DeleteRow_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (this.DataGridList.Rows.Count != 0)
            {
                int num;
                for (num = 0; num < this.DataGridList.Rows.Count; num++)
                {
                    if (this.DataGridList.Rows[num].Cells[0].FormattedValue.ToString() == "True")
                    {
                        object obj2 = this.DataGridList.Rows[num].Cells[12].Value;
                        if (obj2 != null)
                        {
                            TeaMixedCommBll.Delete(int.Parse(obj2.ToString()));
                        }
                    }
                }
                for (num = 0; num < this.DataGridList.Rows.Count; num++)
                {
                    if (this.DataGridList.Rows[num].Cells[0].FormattedValue.ToString() == "True")
                    {
                        this.fh.DelRow(this.DataGridList, num);
                    }
                }
                this.fh.DelRow(this.DataGridList, this.DataGridList.Rows.Count - 1);
                this.fh.TotalRow(this.DataGridList, 4);
            }
        }

        private void link_SelectComm_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.txt_CommName_Click(null, null);
        }

        private void LoadMixedDeticl()
        {
            DataTable list = TeaMixedCommBll.GetList("Mixed=" + this.id);
            foreach (DataRow row in list.Rows)
            {
                CommEnt model = CommBll.GetModel(int.Parse(row["CommId"].ToString()));
                CommTypeEnt ent2 = null;
                if (model != null)
                {
                    ent2 = CommTypeBll.GetModel(model.CommTypeId);
                }
                this.DataGridList.Rows.Add();
                StockEnt ent3 = StockBll.GetModel(int.Parse(row["StockId"].ToString()));
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[1].Value = ent3.LotNum;
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[2].Value = ent2.CommTypeName;
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[3].Value = model.CommName;
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[4].Value = decimal.Parse(row["Weight"].ToString()).ToString("F2");
                ParameterEnt ent4 = ParameterBll.GetModel(int.Parse(row["CommUnit"].ToString()));
                if (ent4 != null)
                {
                    this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[5].Value = ent4.ParName;
                }
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[6].Value = model.CommSpec;
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[7].Value = row["CommId"].ToString();
                if (ent2 != null)
                {
                    this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[8].Value = model.CommTypeId.ToString();
                }
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[9].Value = row["CommUnit"].ToString();
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[11].Value = row["StockId"].ToString();
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[10].Value = row["DlId"].ToString();
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[12].Value = row["MixedCommId"].ToString();
            }
            this.fh.TotalRow(this.DataGridList, 4);
        }

        private void pan_td0_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td0, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td1_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td1, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td10_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td10, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td11_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td11, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td12_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td12, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td13_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td13, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td14_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td14, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td15_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td15, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td16_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td16, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td17_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td17, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td2_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td2, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td3, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td4_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td4, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td5_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td5, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td6_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td6, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td7_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td7, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td8_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td8, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td9_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td9, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void panel_BiTian_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_BiTian, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void panel_Button_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_Button, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        private void panel_XuanTian_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_XuanTian, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 0);
        }

        private void panel3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel3, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.Return)
            {
                if (this.DataGridList.IsCurrentCellInEditMode)
                {
                    if (this.DataGridList.CurrentCell.ColumnIndex == 4)
                    {
                        for (int i = 0; i < 6; i++)
                        {
                            SendKeys.Send("{tab}");
                        }
                    }
                    else
                    {
                        SendKeys.Send("{tab}");
                    }
                    return true;
                }
                if (this.DataGridList.CurrentCell.ColumnIndex == 3)
                {
                    this.txt_CommName_Click(this.DataGridList.CurrentCell.RowIndex);
                    return true;
                }
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        private void txt_CommName_Click(int SelectIndex)
        {
            if (this.frmStockSelect == null)
            {
                this.frmStockSelect = new FrmStockSelect();
            }
            if (this.frmStockSelect.ShowDialog() == DialogResult.OK)
            {
                CommTypeEnt model = CommTypeBll.GetModel(this.frmStockSelect.selectStock.CommTypeId);
                this.DataGridList.Rows[SelectIndex].Cells[2].Value = model.CommTypeName;
                this.DataGridList.Rows[SelectIndex].Cells[1].Value = this.frmStockSelect.selectStock.LotNum;
                this.DataGridList.Rows[SelectIndex].Cells[7].Value = this.frmStockSelect.selectStock.CommId.ToString();
                CommEnt ent2 = CommBll.GetModel(int.Parse(this.frmStockSelect.selectStock.CommId.ToString()));
                this.DataGridList.Rows[SelectIndex].Cells[8].Value = this.frmStockSelect.selectStock.CommTypeId.ToString();
                this.DataGridList.Rows[SelectIndex].Cells[3].Value = this.frmStockSelect.selectStock.CommName;
                this.DataGridList.Rows[SelectIndex].Cells[9].Value = ent2.CommUnit;
                ParameterEnt ent3 = ParameterBll.GetModel(int.Parse(ent2.CommUnit));
                this.DataGridList.Rows[SelectIndex].Cells[5].Value = ent3.ParName;
                this.DataGridList.Rows[SelectIndex].Cells[6].Value = ent2.CommSpec;
                this.DataGridList.Rows[SelectIndex].Cells[10].Value = this.frmStockSelect.selectStock.DlId;
                this.DataGridList.Rows[SelectIndex].Cells[11].Value = this.frmStockSelect.selectStock.StockId;
                this.DataGridList.CurrentCell = this.DataGridList[4, SelectIndex];
            }
        }

        private void txt_CommName_Click(object sender, EventArgs e)
        {
            if (this.selectComm == null)
            {
                this.selectComm = new FrmSelectComm();
            }
            if (this.selectComm.ShowDialog() == DialogResult.OK)
            {
                this.lbl_CommId.Text = this.selectComm.SelectComm.CommId.ToString();
                this.txt_CommName.Text = this.selectComm.SelectComm.CommName;
                this.lbl_CommTypeId.Text = this.selectComm.SelectComm.CommTypeId.ToString();
                this.drp_CommUnit.SelectValueNew = this.selectComm.SelectComm.CommUnit;
                if ((this.selectComm.SelectComm.CommDefaultDlId.ToString() != "") && (this.selectComm.SelectComm.CommDefaultDlId.ToString() != "0"))
                {
                    this.drp_DlList.SelectValueNew = this.selectComm.SelectComm.CommDefaultDlId.ToString();
                }
                this.drp_CommUnit.Select();
            }
        }

        private void txt_CommPrice_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.txt_Remark.Select();
            }
        }

        private void txt_NewTeaWeight_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.link_SelectComm.Select();
            }
        }

        private void txt_Remark_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.DataGridList.Select();
                this.DataGridList.CurrentCell = this.DataGridList.Rows[0].Cells[3];
                this.DataGridList.Rows[0].Cells[3].Selected = true;
            }
        }
    }
}

